package com.company.management.utils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

public class FileUtil {
    public static List<Path> findApikFiles(String directory) throws IOException {
        List<Path> apikFiles = new ArrayList<>();
        Path dir = Paths.get(directory);

        Files.walk(dir)
                .filter(Files::isRegularFile)
                .filter(path -> path.toString().endsWith(".apk"))
                .forEach(apikFiles::add);

        return apikFiles;
    }
}
